
import numpy as np


def gen_points(center_x, center_y, n_points, radius=10):
    # Generate random points inside the circle
    res = []
    while len(res) < n_points:
        x = np.random.uniform(center_x - radius, center_x + radius)
        y = np.random.uniform(center_y - radius, center_y + radius)
        if (x - center_x) ** 2 + (y - center_y) ** 2 <= radius ** 2:
            res.append((x, y))
    return res


def calculate_adjacency_matrix(points):
    n_points = len(points)
    adjacency_matrix = np.zeros((n_points, n_points))
    for i in range(n_points):
        for j in range(n_points):
            if i != j:
                adjacency_matrix[i][j] = np.sqrt(
                    (points[i][0] - points[j][0]) ** 2 + (points[i][1] - points[j][1]) ** 2)
    return adjacency_matrix


if __name__ == '__main__':
    center_x, center_y = 10, 10
    n_points = 10
    points = gen_points(center_x, center_y, n_points)

    adjacency_matrix = calculate_adjacency_matrix(points)
    print("Generated Points:", points)
    print("Adjacency Matrix:\n", adjacency_matrix)
